// eee.Sheffield.PZ.Imaging
//
// Copyright ?Ping Zou, 2007
// sg71.cherub@gmail.com

using System;
using System.Collections.Generic;
using System.Text;
using eee.Sheffield.PZ.Math;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

namespace eee.Sheffield.PZ.Imaging.ImageFilter
{
    public class Closing : ImageFilter//, IGraylevelImageFilter
    {
        #region Fields
        #endregion

        #region Fields
        #endregion

        #region Constructor
        public Closing()
        {
            _flag = "[Image -> Morphology -> Closing]";
        }
        #endregion

        #region Apply filter
        protected override PZMath_matrix ApplyDoubleGraylevelImageFilter(PZMath_matrix srcMatrix, out string logText)
        {
            Dilation dilation = new Dilation();
            Erosion erosion = new Erosion();

            PZMath_matrix dstMatrix = erosion.ApplyDoubleGraylevelImageFilter(dilation.ApplyDoubleGraylevelImageFilter(srcMatrix));
          
            logText = "succed";
            return dstMatrix;
        } // ApplyDoubleGraylevelImageFilter()

        protected override PZMath_matrix[] ApplyDoubleColourImageFilter(PZMath_matrix[] srcMatrixArray, out string logText)
        {
            // TODO: add this function
            throw new Exception("The method or operation is not implemented.");
        } // ApplyDoubleColourImageFilter()
        #endregion        
    }
}
